package com.binguo.api.controller;

import com.binguo.api.form.QrCodeForm;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotNull;

/**
 * Created by haibang on 18/5/7.
 */

@Controller
public class QrCodeController {

    private static Logger logger = LoggerFactory.getLogger(QrCodeController.class);


    @RequestMapping(value = "/api/qrcode")
    public String qrcode(@RequestParam @NotNull String wxqrcode,
                         @RequestParam @NotNull String totalFee,
                         @RequestParam @NotNull String aliqrcode,
                         Model model) {
        QrCodeForm qrCodeForm = QrCodeForm.builder()
                .wxQrcode(wxqrcode)
                .totalFee(totalFee)
                .aliQrcode(aliqrcode).build();

        model.addAttribute("qrCodeForm", qrCodeForm);
        return "index";
    }




}
